/**
 * Created by HFY on 2017/3/27.
 */

var text = document.getElementById("text")
var pass = document.getElementById("pass")
var pwd = document.getElementById("pwd")

text.onfocus = function () {
        if(text.value == "账号") {
            text.value = "";
            text.style.color = "#333"
        };
};
text.onblur= function () {
    if(text.value == "") {
        text.value = "账号";
        text.style.color = "#B4B4B4"
    };
};
pwd.onfocus = function () {
    if(this.value =="密码")
        this.style.display="none";
        pass.style.display="block";
        this.value ="";
        pass.value="";
    pass.style.color = "#333"
        pass.focus();
    }
pass.onblur=function(){
    if(this.value ==""){
        pwd.style.display = "block"
        pwd.value="密码";
        pass.style.display = "none"
    }else {
        pwd.style.display = "none";
        pass.style.display = "block"
    }
};

console.log("登录")